package com.langsin.crmpro.action;

import java.util.HashSet;
import java.util.Set;

import com.langsin.crmpro.manager.ProvinceManager;
import com.langsin.crmpro.model.SCity;
import com.langsin.crmpro.model.SProvince;
import com.opensymphony.xwork2.ActionSupport;

public class ProvinceAction extends ActionSupport{
	
	private static final long serialVersionUID = -7035349274341560688L;
	
	private Integer id;

	private Set<SCity> sCities = new HashSet<SCity>();
	
	private ProvinceManager provinceManager;

	public String getCities()throws Exception{
		
		SProvince sProvince = this.provinceManager.getCities(this.id);
		this.sCities = sProvince.getSCities();
		return SUCCESS;
	}
	
	public void setProvinceManager(ProvinceManager provinceManager) {
		this.provinceManager = provinceManager;
	}

	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public Set<SCity> getSCities()
	{
		return sCities;
	}

	public void setSCities(Set<SCity> cities)
	{
		sCities = cities;
	}
	
}
